package com.mysoft.gfyx.workbench.subscriber.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.mysoft.framework.event.info.EventMessage;
import lombok.Data;

import java.util.Date;
import java.util.List;

@Data
public class BusinessUnitDto extends EventMessage<Void> {
    @JsonProperty("AreaType")
    private String areaType;

    @JsonProperty("BuCode")
    private String buCode;

    @JsonProperty("BuCoreFullName")
    private String buCoreFullName;

    @JsonProperty("BuFullName")
    private String buFullName;

    @JsonProperty("BuName")
    private String buName;

    @JsonProperty("IsCompany")
    private boolean isCompany;

    @JsonProperty("IsDisabled")
    private boolean isDisabled;

    @JsonProperty("IsEndCompany")
    private boolean isEndCompany;

    @JsonProperty("IsEndDepartment")
    private boolean isEndDepartment;

    @JsonProperty("IsFc")
    private int isFc;

    @JsonProperty("Level")
    private int level;

    @JsonProperty("NamePath")
    private String namePath;

    @JsonProperty("OrderCode")
    private String orderCode;

    @JsonProperty("OrderHierarchyCode")
    private String orderHierarchyCode;

    @JsonProperty("ParentId")
    private String parentId;

    @JsonProperty("PartitionId")
    private int partitionId;

    @JsonProperty("ProjId")
    private String projId;

    @JsonProperty("ProvinceId")
    private String provinceId;

    @JsonProperty("RefStationName")
    private String refStationName;

    @JsonProperty("WebSite")
    private String webSite;

    @JsonProperty("BusinessUnitId")
    private String businessUnitId;

    @JsonProperty("CreatedId")
    private String createdId;

    @JsonProperty("CreatedName")
    private String createdName;

    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSXXX")
    @JsonProperty("CreatedTime")
    private Date createdTime;

    @JsonProperty("ModifiedId")
    private String modifiedId;

    @JsonProperty("ModifiedName")
    private String modifiedName;

    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSXXX")
    @JsonProperty("ModifiedTime")
    private Date modifiedTime;

    @JsonProperty("IsTest")
    private boolean isTest;

    @JsonProperty("ThirdPartyId")
    private String thirdPartyId;

    @JsonProperty("ExtendAttrs")
    private List<ExtendAttr> extendAttrs;

    @JsonProperty("IsUpdatedParent")
    private boolean isUpdatedParent;

    @JsonProperty("OriBusinessParentId")
    private String oriBusinessParentId;


    // 内部类，表示ExtendAttrs中的元素
    public static class ExtendAttr {
        @JsonProperty("Name")
        private String name;

        @JsonProperty("Value")
        private String value;

        // Getters and setters

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public String getValue() {
            return value;
        }

        public void setValue(String value) {
            this.value = value;
        }
    }
}
